package cn.com.shopec.erp.system.service;

import java.util.List;

import cn.com.shopec.erp.common.page.PageFinder;
import cn.com.shopec.erp.common.page.PageQuery;
import cn.com.shopec.erp.system.entity.User;
import cn.com.shopec.erp.system.vo.RoleVo;
import cn.com.shopec.erp.system.vo.UserVo;

/**
 * 
 * @ClassName IUserService
 * @Description 用户Service
 * @author chengui
 * @date 2013-5-30 上午10:59:34
 */
public interface IUserService {
	
	/**
	 * 
	 * @MethodName getPagedUserVos
	 * @Description 获得分页后的用户Vo集合
	 * @author chengui
	 * @date 2013-5-30 上午11:49:02
	 * @param userVo
	 * @param pageQuery
	 * @return
	 * @throws Exception
	 */
	PageFinder<UserVo> getPagedUserVos(UserVo userVo, PageQuery pageQuery) throws Exception;
	
	/**
	 * 
	 * @MethodName addUser
	 * @Description 新增供应链用户
	 * @author chengui
	 * @date 2013-5-30 下午2:12:48
	 * @param userVo
	 * @throws Exception
	 */
	public void addUser(UserVo userVo) throws Exception;
	
	/**
	 * 
	 * @MethodName isUserExist
	 * @Description 检查用户是否已经存在
	 * @author chengui
	 * @date 2013-5-30 下午2:36:39
	 * @param userVo
	 * @return
	 * @throws Exception
	 */
	public String isUserExist(UserVo userVo) throws Exception;
	
	/**
	 * 
	 * @MethodName getUserVo
	 * @Description 获得供应链用户Vo
	 * @author chengui
	 * @date 2013-5-30 下午3:19:32
	 * @param userVo
	 * @return
	 * @throws Exception
	 */
	public UserVo getUserVo(UserVo userVo) throws Exception;
	
	/**
	 * 
	 * @MethodName modifyUser
	 * @Description 修改供应链用户
	 * @author chengui
	 * @date 2013-5-30 下午3:27:03
	 * @param userVo
	 * @return
	 * @throws Exception
	 */
	public void modifyUser(UserVo userVo) throws Exception;
	
	/**
	 * 
	 * @MethodName modifyPassword
	 * @Description 修改密码
	 * @author chengui
	 * @date 2013-5-30 下午3:44:54
	 * @param userVo
	 * @throws Exception
	 */
	public String modifyPassword(UserVo userVo) throws Exception;
	
	/**
	 * 
	 * @MethodName lockUser
	 * @Description 锁定用户
	 * @author chengui
	 * @date 2013-5-30 下午3:58:43
	 * @param userVo
	 * @throws Exception
	 */
	public void lockUser(UserVo userVo) throws Exception;
	
	/**
	 * 
	 * @MethodName unlockUser
	 * @Description 解锁用户
	 * @author chengui
	 * @date 2013-5-30 下午4:07:36
	 * @param userVo
	 * @throws Exception
	 */
	public void unlockUser(UserVo userVo) throws Exception;
	
	/**
	 * 
	 * @MethodName deleteUser
	 * @Description 删除用户
	 * @author chengui
	 * @date 2013-5-30 下午4:07:51
	 * @param userVo
	 * @throws Exception
	 */
	public void deleteUser(UserVo userVo) throws Exception;
	
	/**
	 * 
	 * @MethodName getOwnRoleVos
	 * @Description 获得自己拥有的角色
	 * @author chengui
	 * @date 2013-5-30 下午8:28:44
	 * @param userVo
	 * @return List<RoleVo>
	 * @throws Exception
	 */
	public List<RoleVo> getOwnRoleVos(UserVo userVo) throws Exception;
	
	/**
	 * 
	 * @MethodName getLeftRoleVos
	 * @Description 获得自己不拥有的角色
	 * @author chengui
	 * @date 2013-5-30 下午8:35:49
	 * @param roleVos
	 * @param ownRoleVos
	 * @return List<RoleVo>
	 * @throws Exception
	 */
	public List<RoleVo> getLeftRoleVos(List<RoleVo> roleVos, List<RoleVo> ownRoleVos)  throws Exception;
	
	/**
	 * 
	 * @MethodName allocateRole
	 * @Description 分配角色
	 * @author chengui
	 * @date 2013-5-31 上午9:31:08
	 * @param userVo
	 * @throws Exception
	 */
	public void allocateRole(UserVo userVo) throws Exception;
	
	/**
	 * 
	 * @MethodName getUserVo
	 * @Description 通过用户名查询用户
	 * @author chengui
	 * @date 2013-6-4 下午1:57:58
	 * @param loginName
	 * @return UserVo
	 * @throws Exception
	 */
	public UserVo getUserVoByLoginName(String loginName) throws Exception;

	/**
	 *根据id取对象
	 * @param id
	 * @return
	 */
	public User getUserById(String id);
	
}
